import App from './App'
import Vue from 'vue'

import uView from '@/uni_modules/uview-ui'
Vue.use(uView);

import base from "./mixins/index.js"
Vue.mixin(base)

import store from './store' //引入vuex

// 引入状态栏高度
import confirm from './components/confirm.vue'
Vue.component('confirm', confirm)

// 引入状态栏高度
import StatusBar from './components/status-bar.vue'
Vue.component('status-bar', StatusBar)

// 引入导航栏
import TopBar from './components/top-bar.vue'
Vue.component("top-bar", TopBar);

import config from './config/config.js'
Vue.prototype.$config = config

import api from './api/index.js'
Vue.prototype.api = api
Vue.prototype.defaultAddress = ""

// 语言
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)

const i18n = new VueI18n({
	locale: store.state.lang ? store.state.lang.toString() : 'zh', // 语言标识
	messages: {
		'zh': require('./common/lang/zh'), // 中文简体语言包
		'en': require('./common/lang/en'), // 英语
	},
	silentTranslationWarn: true,
})


Vue.prototype.$onLaunched = new Promise(resolve => {
	Vue.prototype.$isResolve = resolve
})


if (process.env.NODE_ENV !== 'development') console.log = () => {} //生产模式

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	i18n,
	store,
	...App
})
app.$mount()
export default app;